cmake_minimum_required(VERSION 3.20)

set(CMAKE_GENERATOR_TOOLSET "Intel(R) oneAPI DPC++ Compiler 2024")
set(CMAKE_CXX_COMPILER "C:/Program Files (x86)/Intel/oneAPI/compiler/2024.1/bin/ipcx.exe")


project(oneapi_learn LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")

add_compile_options("$<$<C_COMPILER_ID:MSVC>:/utf-8>")  # 对于C语言
add_compile_options("$<$<CXX_COMPILER_ID:MSVC>:/utf-8>") # 对于C++语言

# add_definitions("-DNDEBUG")

set(THIRD_PARTY_DIR "${CMAKE_SOURCE_DIR}/3rdparty")

# add_subdirectory(3rdparty)

set(TARGET_NAME ${CMAKE_PROJECT_NAME})


# 设置项目源代码和头文件
file(GLOB_RECURSE HEADER_FILES "*.h" "*.hpp")
file(GLOB_RECURSE SOURCE_FILES "src/*.cpp")

add_executable(${TARGET_NAME} main.cpp ${SOURCE_FILES} ${HEADER_FILES})

target_compile_options(${TARGET_NAME} PRIVATE -fsycl)
target_include_directories(${TARGET_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
target_include_directories(${TARGET_NAME} PUBLIC "C:/Program Files (x86)/Intel/oneAPI/compiler/latest/include")
target_include_directories(${TARGET_NAME} PUBLIC "C:/Program Files (x86)/Intel/oneAPI/dpcpp-ct/latest/include")
target_include_directories(${TARGET_NAME} PUBLIC $<BUILD_INTERFACE:${THIRD_PARTY_DIR}>)


